package com.ssy.lingxi.system.controller;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.PageModel;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.system.dto.request.MemberEquitiesUpdateRequest;
import com.ssy.lingxi.system.dto.response.MemberEquitiesResponse;
import com.ssy.lingxi.system.entity.MemberEquities;
import com.ssy.lingxi.system.service.MemberEquitiesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
 * @menu 会员设置-会员权益配置管理
 * @author wrc
 * @date 2020/7/20
 */
@Api(tags = "会员权益配置管理")
@RestController
public class MemberEquitiesController {
    @Autowired
    MemberEquitiesService memberEquitiesService;

    @ApiOperation(value = " 查询会员权益配置列表")
    @GetMapping("/member/equities/list")
    public Wrapper<PageData<MemberEquitiesResponse>> memberEquitiesList(PageModel request) {
        return memberEquitiesService.memberEquitiesList(request);
    }

    @ApiOperation(value = " 停用或启动会员权益配置")
    @PostMapping("/member/equities/update")
    public Wrapper memberEquitiesUpdate(@RequestBody MemberEquitiesUpdateRequest request) {
        return memberEquitiesService.memberEquitiesUpdate(request);
    }


    @ApiOperation(value = " 查询全部会员权益配置列表")
    @GetMapping("/member/equities/all")
    public Wrapper<List<MemberEquities>> memberEquitiesAll() {
        return memberEquitiesService.memberEquitiesAll();
    }



}
